﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys0a00
    {
		private string _usercode;
		private string _username;
		private string _userpwd;
        private bool? _islock;
        private int? _comcode;
		private string _empno;
        private DateTime? _mdate;
		private string _muser;
		private string _supermk;
		
        /// <summary>
        /// 用户编码
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 用户名称
        /// </summary>
		public string Username
		{
			get { return _username;	 }
			set { _username=value;	}
		}
        /// <summary>
        /// 用户密码
        /// </summary>
		public string Userpwd
		{
			get { return _userpwd;	 }
			set { _userpwd=value;	}
		}
        /// <summary>
        /// 是否锁定
        /// </summary>
		public bool? Islock
		{
			get { return _islock;	 }
			set { _islock=value;	}
		}
        /// <summary>
        /// 公司标识
        /// </summary>
		public int? Comcode
		{
			get { return _comcode;	 }
			set { _comcode=value;	}
		}
        /// <summary>
        /// 人员标识
        /// </summary>
		public string Empno
		{
			get { return _empno;	 }
			set { _empno=value;	}
		}
        /// <summary>
        /// 维护时间
        /// </summary>
		public DateTime? Mdate
		{
			get { return _mdate;	 }
			set { _mdate=value;	}
		}
        /// <summary>
        /// 维护者
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Supermk
		{
			get { return _supermk;	 }
			set { _supermk=value;	}
		}
		
		public static List<Sys0a00> GetSys0a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys0a00> list = new List<Sys0a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys0a00 model = GetSys0a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys0a00 GetSys0a00ByDataRow(DataRow dr)
		{
			Sys0a00 model = new Sys0a00(); //实例化Sys0a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("username")&&!(dr["username"] is System.DBNull))  
				model.Username = ( string)dr["username"];
			if (dcc.Contains("userpwd")&&!(dr["userpwd"] is System.DBNull))  
				model.Userpwd = ( string)dr["userpwd"];
			if (dcc.Contains("islock")&&!(dr["islock"] is System.DBNull))  
				model.Islock = ( bool)dr["islock"];
			if (dcc.Contains("comcode")&&!(dr["comcode"] is System.DBNull))  
				model.Comcode = ( int)dr["comcode"];
			if (dcc.Contains("empno")&&!(dr["empno"] is System.DBNull))  
				model.Empno = ( string)dr["empno"];
			if (dcc.Contains("mdate")&&!(dr["mdate"] is System.DBNull))  
				model.Mdate = ( DateTime)dr["mdate"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("supermk")&&!(dr["supermk"] is System.DBNull))  
				model.Supermk = ( string)dr["supermk"];
			
			return model;
		}
    }
}
